//病程模板
<template>
  <div class="medical-record">
    <!-- 文档容器 -->
    <div class="document-container">

      <!-- 文档标题 -->
      <div class="document-title">
        <h2 class="main-title">{{ initialData.mainTitle }}</h2>
        <p class="sub-title">{{ initialData.subTitle }}</p>
      </div>

      <!-- 基本信息表格 -->
      <div class="info-table-section">
        <table class="info-table">
          <tr>
            <td class="label">姓名</td>
            <td class="value">{{ initialData.name }}</td>
            <td class="label">性别</td>
            <td class="value">{{ initialData.gender }}</td>
            <td class="label">年龄</td>
            <td class="value">{{ initialData.age }}</td>
          </tr>
          <tr>
            <td class="label">科室</td>
            <td class="value">{{ initialData.department }}</td>
            <td class="label">床号</td>
            <td class="value">{{ initialData.bedNumber }}</td>
            <td class="label">病案号</td>
            <td class="value">{{ initialData.caseNumber }}</td>
          </tr>
        </table>
      </div>

      <!-- 记录时间 -->
      <div class="record-datetime">
        记录时间：{{ initialData.recordDateTime }}
      </div>

      <!-- 文档内容区域 -->
      <div class="document-content">
        <!-- 首次病程记录 -->
        <div class="content-section">
          <div class="section-title">首次病程记录</div>
          <div class="section-content">{{ initialData.firstRecord }}</div>
        </div>

        <!-- 病例特点 -->
        <div class="content-section">
          <div class="section-title">病例特点</div>
          <div class="section-content">{{ initialData.caseFeatures }}</div>
        </div>

        <!-- 诊断信息 -->
        <div class="content-section">
          <div class="section-title">诊断信息</div>
          <div class="section-content">
            <div class="sub-section">
              <div class="sub-title">初步诊断：</div>
              <div class="sub-content">{{ initialData.initialDiagnosis }}</div>
            </div>
            <div class="sub-section">
              <div class="sub-title">诊断依据：</div>
              <div class="sub-content">{{ initialData.diagnosisBasis }}</div>
            </div>
            <div class="sub-section">
              <div class="sub-title">鉴别诊断：</div>
              <div class="sub-content">{{ initialData.diffDiagnosis }}</div>
            </div>
          </div>
        </div>

        <!-- 诊疗计划 -->
        <div class="content-section">
          <div class="section-title">诊疗计划</div>
          <div class="section-content">{{ initialData.treatmentPlan }}</div>
        </div>

        <!-- 手术记录 -->
        <div class="content-section">
          <div class="section-title">手术记录</div>
          <div class="section-content">{{ initialData.surgeryRecord }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  initialData: {
    type: Object,
    default: () => ({}),
  },
});
</script>

<style scoped>
.medical-record {
  background-color: #fff;
  min-height: 100vh;
  padding: 20px;
}

.document-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px;
  background: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.document-header {
  margin-bottom: 30px;
  text-align: center;
}

.hospital-name {
  font-size: 24px;
  font-weight: bold;
  color: #000;
  margin: 0;
}

.document-line {
  height: 2px;
  background: #000;
  margin: 15px 0;
}

.document-title {
  text-align: center;
  margin-bottom: 30px;
}

.main-title {
  font-size: 20px;
  font-weight: bold;
  margin: 0 0 8px 0;
  color: #000;
}

.sub-title {
  font-size: 16px;
  color: #333;
  margin: 0;
}

.info-table-section {
  margin-bottom: 20px;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.info-table td {
  padding: 8px 12px;
  border: 1px solid #ddd;
}

.info-table .label {
  background-color: #f8f8f8;
  font-weight: 500;
  width: 80px;
  color: #333;
}

.info-table .value {
  width: 120px;
}

.record-datetime {
  text-align: right;
  color: #666;
  margin-bottom: 30px;
  font-size: 14px;
}

.document-content {
  line-height: 1.8;
}

.content-section {
  margin-bottom: 30px;
}

.section-title {
  font-size: 16px;
  font-weight: bold;
  color: #000;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eee;
}

.section-content {
  color: #333;
  font-size: 14px;
  line-height: 1.8;
  text-align: justify;
  padding: 0 8px;
}

.sub-section {
  margin-bottom: 16px;
}

.sub-title {
  font-weight: 500;
  margin-bottom: 8px;
  color: #333;
}

.sub-content {
  color: #333;
  line-height: 1.8;
  padding-left: 16px;
}

@media print {
  .medical-record {
    padding: 0;
  }

  .document-container {
    box-shadow: none;
    padding: 20px;
  }

  .info-table td {
    border-color: #000;
  }

  .section-title {
    border-bottom-color: #000;
  }
}

@media (max-width: 768px) {
  .medical-record {
    padding: 10px;
  }

  .document-container {
    padding: 20px;
  }

  .hospital-name {
    font-size: 20px;
  }

  .info-table td {
    padding: 6px 8px;
    font-size: 14px;
  }

  .info-table .label {
    width: 60px;
  }

  .info-table .value {
    width: auto;
  }
}
</style>
